<template>
  <div id="mainportal" class="container" style="">

  <comhead title="物流信息" isLeftIcon="true" leftIconName="angle-left" @leftClick="foBack()" isRightIcon="true" rightIconName="ellipsis-h" @rightClick="updataActive()"></comhead>
   


<div style="font-size:14px;">
  <div style='padding:10px;'>
    <div>
      物流状态: <span style='color:#1973bf'>{{shipStatus}}</span>
    </div>
    <div style='color:#999'>
      物流公司: {{shipper_code}}
    </div>

    <div style='color:#999'>
      物流单号: {{shipList.logistic_code}}
    </div>
        <div style='color:#999'>
      物流电话:<a :href="'tel:'+shipList.mobile">
<span style='color:#1973bf' bindtap='telShip'>{{shipList.mobile=='null'||!shipList.mobile?'':shipList.mobile}}</span> 
</a>
    </div>

  </div>
  <div style='height:20px;background-color:#f5f5f5;border-top: solid 1px #e5e5e5;border-bottom: solid 1px #e5e5e5;'>
  </div>
  <div v-for="(item,index) in traces" class='itemContent' :style="index==0?'color:#1973bf':''" style="    position: relative;">
    <div style='width:25px;'>
        <div style="    background: #d2d1d1;
    height: 9px;
    width: 9px;
    border-radius: 50px;
    position: absolute;
    bottom: -5px;
    left: -5px;
    z-index: 200;"></div>

    </div>
    <div style='  padding-bottom: 10px ;flex:1;border-bottom:1px #e5e5e5 solid;'>
      <div style='font-size:12px;'>
        {{item.AcceptTime}}
      </div>
      <div>
        {{item.AcceptStation}}
      </div>
    </div>

  </div>

</div>

  </div>
  </div>
</template>

 
 

<script>
import { Toast, Swipe, SwipeItem, Switch, MessageBox } from "mint-ui";
import { Indicator } from "mint-ui";
import { Tabbar, TabItem } from "mint-ui";
import { TabContainer, TabContainerItem } from "mint-ui";
import comhead from "../../common/coffee/Comhead";

export default {
  data() {
    return {
      orderId: "",
      shipList: [],
      shipStatus: "派送中",
      shipper_code: "",
      traces: []
    };
  },
  computed: {},

  methods: {
    handleShipCode(row) {
      switch (row) {
        case "AJ":
          return "安捷快递";
        case "ANE":
          return "安能物流";
        case "AXD":
          return "安信达快递";
        case "BQXHM":
          return "北青小红帽";
        case "BFDF":
          return "百福东方";
        case "BTWL":
          return "百世快运";
        case "CCES":
          return "CCES快递";
        case "CITY100":
          return "城市100";
        case "COE":
          return "COE东方快递";
        case "CSCY":
          return "长沙创一";
        case "CDSTKY":
          return "成都善途速运";
        case "DBL":
          return "德邦";
        case "DSWL":
          return "D速物流";
        case "DTWL":
          return "大田物流";
        case "EMS":
          return "EMS";
        case "FAST":
          return "快捷速递";
        case "FEDEX":
          return "FEDEX联邦(国内件）";
        case "FEDEX_GJ":
          return "FEDEX联邦(国际件）";
        case "FKD":
          return "飞康达";
        case "GDEMS":
          return "广东邮政";
        case "GSD":
          return "共速达";
        case "GTO":
          return "国通快递";
        case "GTSD":
          return "高铁速递";
        case "HFWL":
          return "汇丰物流";
        case "HHTT":
          return "天天快递";
        case "HLWL":
          return "恒路物流";
        case "HOAU":
          return "天地华宇";
        case "hq568":
          return "华强物流";
        case "HTKY":
          return "百世快递";
        case "HXLWL":
          return "华夏龙物流";
        case "HYLSD":
          return "好来运快递";
        case "JGSD":
          return "京广速递";
        case "JIUYE":
          return "九曳供应链";
        case "JJKY":
          return "佳吉快运";
        case "JLDT":
          return "嘉里物流";
        case "JTKD":
          return "捷特快递";
        case "JXD":
          return "急先达";
        case "JYKD":
          return "晋越快递";
        case "JYM":
          return "加运美";
        case "JYWL":
          return "佳怡物流";
        case "KYWL":
          return "跨越物流";
        case "LB":
          return "龙邦快递";
        case "LHT":
          return "联昊通速递";
        case "MHKD":
          return "民航快递";
        case "MLWL":
          return "明亮物流";
        case "NEDA":
          return "能达速递";
        case "PADTF":
          return "平安达腾飞快递";
        case "QCKD":
          return "全晨快递";
        case "QFKD":
          return "全峰快递";
        case "QRT":
          return "全日通快递";
        case "RFD":
          return "如风达";
        case "SAD":
          return "赛澳递";
        case "SAWL":
          return "圣安物流";
        case "SBWL":
          return "盛邦物流";
        case "SDWL":
          return "上大物流";
        case "SF":
          return "顺丰快递";
        case "SFWL":
          return "盛丰物流";
        case "SHWL":
          return "盛辉物流";
        case "ST":
          return "速通物流";
        case "STO":
          return "申通快递";
        case "STWL":
          return "速腾快递";
        case "SURE":
          return "速尔快递";
        case "TSSTO":
          return "唐山申通";
        case "UAPEX":
          return "全一快递";
        case "UC":
          return "优速快递";
        case "WJWL":
          return "万家物流";
        case "WXWL":
          return "万象物流";
        case "XBWL":
          return "新邦物流";
        case "XFEX":
          return "信丰快递";
        case "XYT":
          return "希优特";
        case "XJ":
          return "新杰物流";
        case "YADEX":
          return "源安达快递";
        case "YCWL":
          return "远成物流";
        case "YD":
          return "韵达快递";
        case "YDH":
          return "义达国际物流";
        case "YFEX":
          return "越丰物流";
        case "YFHEX":
          return "原飞航物流";
        case "YFSD":
          return "亚风快递";
        case "YTKD":
          return "运通快递";
        case "YTO":
          return "圆通速递";
        case "YXKD":
          return "亿翔快递";
        case "YZPY":
          return "邮政平邮/小包";
        case "ZENY":
          return "增益快递";
        case "ZHQKD":
          return "汇强快递";
        case "ZJS":
          return "宅急送";
        case "ZTE":
          return "众通快递";
        case "ZTKY":
          return "中铁快运";
        case "ZTO":
          return "中通速递";
        case "ZTWL":
          return "中铁物流";
        case "ZYWL":
          return "中邮物流";
        case "AMAZON":
          return "亚马逊物流";
        case "SUBIDA":
          return "速必达物流";
        case "RFEX":
          return "瑞丰速递";
        case "QUICK":
          return "快客快递";
        case "CJKD":
          return "城际快递";
        case "CNPEX":
          return "CNPEX中邮快递";
        case "HOTSCM":
          return "鸿桥供应链";
        case "HPTEX":
          return "海派通物流公司";
        case "AYCA":
          return "澳邮专线";
        case "PANEX":
          return "泛捷快递";
        case "PCA":
          return "PCA Express";
        case "UEQ":
          return "UEQ Express";
      }
    },
    getShipList() {
      let self = this;
      let url = this.$baseUrl.bizUrl + "/order/transport/userquery";
      let data = {
        token: this.$store.getters.getLoginStatus.token,
        userId: this.$store.getters.getLoginStatus.userId,
        orderId: this.orderId
      };
      let callBack = res => {
        if (res == null) {
          console.log("网络请求错误1！");
          return;
        }

        if (res.data.status != 200) {
          return;
        }
        let traces = [];
        for (let i = res.data.data.traces.length - 1; i > 0; i--) {
          if (res.data.data.traces[i].AcceptStation.indexOf("已签收") != -1) {
            this.shipStatus = "已签收";
          }
          traces.push(res.data.data.traces[i]);
        }
        let opt = this.handleShipCode(res.data.data.shipper_code);
        this.shipList = res.data.data;
        this.traces = traces;
        this.shipper_code = opt;
      };
      this.$reqFormPost(url, data, callBack);
    },
    goSign() {
      this.$router.push({ name: "sign" });
    },
    foBack() {
      this.$router.go(-1);
    }
  },
  mounted() {
    document.title = '物流信息'
    this.orderId = this.$route.query.orderid;
    this.getShipList();
  },
  components: {
    Tabbar,
    TabItem,
    TabContainer,
    TabContainerItem,
    comhead,
    Swipe,
    SwipeItem
  }
};
</script>
<style>
.itemContent {
  border-left: solid #e5e5e5 2px;
  display: flex;
  padding: 10px 10px 0 0;
  margin: 0 0 0 20px;
}
</style>



<!-- Add "scoped" attribute to limit CSS to this component only -->
